{% extends "baseTemp/base.html" %}
{% load staticfiles %}

{# 标题及描述 #}
{% block title %}
	<title>天天生鲜-首页</title>
	<meta name="description" content="">
	<meta name="keywords" content="">
{% endblock title %}

{# 外部资源 #}
{% block resource_link %}
	<script type="text/javascript" src="{% static "js/jquery-1.12.4.min.js" %}"></script>
	<script type="text/javascript" src="{% static "js/jquery-ui.min.js" %}"></script>
	<script type="text/javascript" src="{% static "js/slide.js" %}"></script>
{% endblock resource_link %}

{# 主体部分 #}
{% block body %}
	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">全部商品分类</h1>
			<ul class="navlist fl">
				<li><a href="">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="center_con clearfix">
		{# 商品种类信息 #}
		<ul class="subnav fl">
			{% for type in types %}
				<li><a href="#model0{{ forloop.counter }} " class="{{ type.logo }}">{{ type.name }}</a></li>
			{% endfor %}
		</ul>
		<div class="slide fl">
			{# 轮播图 #}
			<ul class="slide_pics">
				{% for banner in commod_banners %}
					<li><a href="#"><img src="{{ banner.image.url }}" alt="幻灯片"></a></li>
				{% endfor %}
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			{% for banner in promotion_banners %}
				<a href="{{ banner.url }}"><img src="{{ banner.image.url }}"></a>
			{% endfor %}
		</div>
	</div>

	{% for type in types %}
		<div class="list_model">
			<div class="list_title clearfix">
				<h3 class="fl" id="model0{{ forloop.counter }}">{{ type.name }}</h3>
				<div class="subtitle fl">
					{# 商品文字标题信息展示列表 #}
					<span>|</span>
					{% for banner in type.title_banners %}
						<a href="{% url 'commod:detail' banner.sku.id %}">{{ banner.sku.name }}</a>
					{% endfor %}
				</div>
				<a href="{% url 'commod:detail_list' type.id 1 %}" class="goods_more fr" id="fruit_more">查看更多 ></a>
			</div>

			<div class="goods_con clearfix">
				<div class="goods_banner fl"><img src="{{ type.image.url }}"></div>
				<ul class="goods_list fl">
					{% for banner in type.image_banners %}
						{# 商品图片展示列表 #}
						<li>
							<h4><a href="{% url 'commod:detail' banner.sku.id %}">{{ banner.sku.name }}</a></h4>
							<a href="{% url 'commod:detail' banner.sku.id %}"><img src="{{ banner.sku.image.url }}"></a>
							<div class="prize">¥ {{ banner.sku.price }}</div>
						</li>
					{% endfor %}
				</ul>
			</div>
		</div>
	{% endfor %}
{% endblock body %}
